cc.Class({
    extends: cc.Component,

    properties: {
        money : cc.Label,
        diamond : cc.Label,
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
            if(!cc.sys.localStorage.getItem("money")){
                cc.sys.localStorage.setItem("money", "1000")
            }
            this.money.string = cc.sys.localStorage.getItem("money");
            cc.find("Canvas").on("money", function(){
                this.money.string = cc.sys.localStorage.getItem("money");
            },this);
            if(!cc.sys.localStorage.getItem("diamond")){
                cc.sys.localStorage.setItem("diamond", "0")
            }
            this.diamond.string = cc.sys.localStorage.getItem("diamond");
            cc.find("Canvas").on("diamond", function(){
                this.diamond.string = cc.sys.localStorage.getItem("diamond");
            },this);
    },

    // update (dt) {},
});
